package com.joysuch.wwyt.mh.service;

import com.joysuch.wwyt.core.bean.SimpleSelectListBean;
import com.joysuch.wwyt.core.exception.ApiBusinessException;
import com.joysuch.wwyt.mh.bean.MhMajorHazardChemProductRelListBean;
import com.joysuch.wwyt.mh.bean.MhMajorHazardListBean;
import com.joysuch.wwyt.mh.entity.MhMajorHazard;
import com.joysuch.wwyt.mh.entity.MhMajorHazardChemProduct;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface MhMajorHazardService {

    Page<MhMajorHazardListBean> list(Pageable pageable, String name, String levels);

    Page<MhMajorHazard> page(Pageable pageable, String name,Integer status);

    MhMajorHazardChemProduct gethcs(Long id);

    void add(MhMajorHazardChemProductRelListBean mhMajorHazardChemProductRelListBean);

    MhMajorHazardChemProductRelListBean getById(Long id);

    void edit(MhMajorHazardChemProductRelListBean mhMajorHazardChemProductRelListBean);

    void delete(Long id) throws ApiBusinessException;

    Page<MhMajorHazardListBean> get(Pageable pageable);

    List<MhMajorHazard> findByResponsibleDept();

    List<SimpleSelectListBean> getList();

    /**
     * 查询重大危险源数量
     *
     * @param flag 0 : 所有数量 1: 拥有位置的数量
     * @return
     */
    Long getNumForHaveLocation(Integer flag);

    List<MhMajorHazard> findAllHaveLocationForTank();

    /**
     * 获取危险源关联的任务数量
     *
     * @param hazardId 危险源id
     * @return 任务数量
     */
    int getTaskNum(Long hazardId);

}
